<?php
/* @var $this TopicController */
/* @var $model Topic */

$this->breadcrumbs=array(
	'Topics'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'Create Topic', 'url'=>array('create')),
);

?>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'topic-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
                array(
                    'header'=>'',
                    'value'=>'$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)'
                ),  
                array(
                    'name'=>'categoryId',
                    'value' => '$data->category->name',
                    'filter' => CHtml::activeDropDownList($model, 'categoryId', TopicCategory::model()->getIdNameArray(true)),
                ),
		'title',
		array(
                    'name' => 'status',
                    'value' => '$data->status==1?"Hiện":"Ẩn"',
                    'filter' => array(1 => 'Hiện', 0 => 'Ẩn'),
                ),
		array(
                    'name'=>'createTime',
                    'value'=>'date("Y-m-d H:i:s", $data->createTime)',
                    'filter' => FALSE,
                ),
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
